From: Maxim Ermilov Date: Tue, 1 Feb 2011 23:37:43 +0000 (+0300) Subject: boxpointer: fix multi monitor support X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5b95ccae5ff9d9f1430256ca320f42dfb72c1999;p=gnome-shell.git boxpointer: fix multi monitor support https://bugzilla.gnome.org/show_bug.cgi?id=641195 --- diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 2c333624b..5479a27cc 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -414,16 +414,15 @@ BoxPointer.prototype = { if (sourceCenterX < margin) { // Not enough space to the top this._arrowCorner = (this._arrowSide == St.Side.TOP) ? St.Corner.TOPLEFT : St.Corner.BOTTOMLEFT; - resX = 10; - } else if (sourceCenterX > (primary.width - margin)) { + resX = primary.x + 10; + } else if (sourceCenterX > (primary.x + primary.width - margin)) { // Not enough space to the botom this._arrowCorner = (this._arrowSide == St.Side.TOP) ? St.Corner.TOPRIGHT : St.Corner.BOTTOMRIGHT; - resX = primary.width - (10 + natWidth); + resX = primary.x + primary.width - (10 + natWidth); } - resX = Math.max(resX, 10); - resX = Math.min(resX, primary.width - (10 + natWidth)); - + resX = Math.max(resX, primary.x + 10); + resX = Math.min(resX, primary.x + primary.width - (10 + natWidth)); this.setArrowOrigin(sourceCenterX - resX); break; @@ -445,14 +444,14 @@ BoxPointer.prototype = { this._arrowCorner = (this._arrowSide == St.Side.LEFT) ? St.Corner.TOPLEFT : St.Corner.TORIGHT; resY = 10; } - else if (sourceCenterY > (primary.height - margin)) { + else if (sourceCenterY > (primary.y + primary.height - margin)) { // Not enough space to the right this._arrowCorner = (this._arrowSide == St.Side.LEFT) ? St.Corner.BOTTOMLEFT : St.Corner.BOTTOMRIGHT; - resY = primary.height - (10 + natHeight); + resY = primary.y + primary.height - (10 + natHeight); } - resY = Math.max(resY, 10); - resY = Math.min(resY, primary.height - (10 + natHeight)); + resY = Math.max(resY, primary.y + 10); + resY = Math.min(resY, primary.y + primary.height - (10 + natHeight)); this.setArrowOrigin(sourceCenterY - resY); break;